export * from './curve';
export * from './point';


/**
MIT License

Copyright (c) 2016 Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
 */

type AugmentedRequired<T extends object, K extends keyof T = keyof T> = Omit<
  T,
  K
> &
  Required<Pick<T, K>>;
export type IPlank = Awaited<
  ReturnType<typeof Manycore.Integration.Bom.getPlankListAsync>
>['result'][0];
export type Profile = IPlank['finishedProfile'];
export type Hole = IPlank['holes'][0];
export type Groove = IPlank['grooves'][0];
export type IPathGroove = AugmentedRequired<Groove, 'path' | 'width'>;
export type Path = IPathGroove['path'];
export type Number3 = Hole['start'];
export enum ETextureDirection {
  Horizontal = 'HORIZONTAL',
  vertical = 'VERTICAL',
}
/**
 * 槽工艺类型
 */
export enum EBomPlankGrooveType {
  /**
   * 板件槽
   */
  PLANK = 'PLANK',
  /**
   * 五金槽
   */
  FITTING = 'FITTING',
  /**
   * 辅助槽
   */
  AUXILIARY = 'AUXILIARY',
  /**
   * 拉米诺槽
   */
  LAMELLO = 'LAMELLO',
  /**
   * 乐扣槽
   */
  LOCK = 'LOCK',
}
/**
 * 槽几何类型
 */
export enum EGrooveGeometryType {
  /**
   * 方槽
   */
  SQUARE = 'SQUARE',
  /**
   * 圆角方槽
   */
  ROUND_CORNER = 'ROUND_CORNER',
  /**
   * 路径槽
   */
  PATH = 'PATH',
  /**
   * 异形槽
   */
  SPECIAL_SHAPED = 'SPECIAL_SHAPED',
}
/**
 * 线段类型
 */
export enum EBomCurveType {
  /**
   * 线段
   */
  LineSeg = 'LineSeg',
  /**
   * 弧线
   */
  Arc = 'Arc',
}
/** 订单状态枚举 */
export enum OrderState {
  /** 已认领 @deprecated */
  claimed = 2,
  /** 排产中 @deprecated */
  productionScheduling = 5,
  /** 已审核 @deprecated */
  reviewed = 6,
  /** 已退回 @deprecated */
  returned = 8,
  /** 已创建 */
  created = 27,
  /** 待设计 */
  designPending = 28,
  /** 待确定 */
  confirmPending = 18,
  /** 已确定 */
  confirmed = 0,
  /** 已下单 */
  ordered = 1,
  /** 待审核 */
  reviewPending = 17,
  /** 待付款 */
  payPending = 3,
  /** 已付款 */
  paid = 4,
  /** 待收款 */
  payCollectPending = 19,
  /** 已收款 */
  payCollected = 20,
  /** 待拆单 */
  splitOrderPending = 21,
  /** 已拆单 */
  splited = 7,
  /** 合批中 */
  merging = 29,
  /** 已合批 */
  merged = 10,
  /** 已排产 */
  productionScheduled = 30,
  /** 已备料 */
  materialPrepared = 25,
  /** 已开料 */
  openedMaterial = 11,
  /** 已封边 */
  edgeSealed = 12,
  /** 已排孔 */
  holesArranged = 13,
  /** 已分拣 */
  picked = 26,
  /** 已包装 */
  packed = 14,
  /** 已入库 */
  warehoused = 15,
  /** 已发货 */
  shipped = 16,
  /** 已完成 */
  completed = 24,
  /** 已取消 */
  cancelled = 9,
}

/* ------ */

export type Point = [number, number];
export type Point3 = [number, number, number];
export interface Rect {
  width: number;
  height: number;
}
